import 'package:my_flutter_core/my_flutter_core.dart';

class JoinAccountGroupRequest {
  JoinAccountGroupRequest({this.id, this.owner, this.sender, this.lastUpdated});

  String? id;
  User? owner;
  User? sender;
  DateTime? lastUpdated;

  factory JoinAccountGroupRequest.fromJson(Map<String, dynamic> json) {
    return JoinAccountGroupRequest(
      id: json['id']?.toString(),
      owner: User.fromJson(json['owner']),
      sender: User.fromJson(json['sender']),
      lastUpdated: tryToConvert<DateTime>(
        json['lastUpdated'],
        (p) => parseDate(p),
      ),
    );
  }
}
